package com.ztsoft.user.controller.dynamic;

import com.ztsoft.user.common.base.NewBaseController;
import com.ztsoft.user.pojo.entity.dynamic.FormDetail;
import com.ztsoft.user.pojo.enums.ResultCode;
import com.ztsoft.user.service.dynamic.FormDetailService;
import com.ztsoft.user.utils.Result;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/formDetail")
@RestController
@Api(tags = "表单信息模块")
@CrossOrigin("*")
public class FormDetailController extends NewBaseController<FormDetail, String, FormDetailService> {

    @Override
    public Result save(@RequestBody FormDetail formDetail) {
        baseService.saveFormDetail(formDetail);
        return Result.success();
    }

    @GetMapping("/queryAllFormDetail")
    public Result queryAllFormDetail(FormDetail formDetail) {

        List<FormDetail> list = baseService.queryAllFormDetail(formDetail);
        return Result.returnDataMsg(ResultCode.SUCCESS.getMsg(), ResultCode.SUCCESS.getCode(), list);
    }
}
